package com.roamer.audition.server.query;

import com.roamer.audition.server.entity.AuditionRecord;
import com.roamer.audition.server.query.base.PageQuery;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.jpa.domain.Specification;

/**
 * 面试计划 查询对象
 *
 * @author roamer
 * @version V1.0
 * @date 2019/8/26 1:14 下午
 */
@ApiModel("面试计划分页查询Query")
@EqualsAndHashCode(callSuper = true)
@Data
public class AuditionRecordPageQuerySpecification extends PageQuery<AuditionRecord> {
    private static final long serialVersionUID = -3951402850295434514L;

    @ApiModelProperty(value = "开始日期区间起始", notes = "大于等于")
    private Long beginTimeFrom;

    @ApiModelProperty(value = "开始日期区间终止", notes = "小于等于")
    private Long beginTimeTo;

    @ApiModelProperty(value = "结束日期区间开始", notes = "大于等于")
    private Long endTimeFrom;

    @ApiModelProperty(value = "结束日期区间终止", notes = "小于等于")
    private Long endTimeTo;

    @ApiModelProperty(value = "面试评分", allowableValues = "range[1, 5]")
    private Byte score;

    @ApiModelProperty(value = "进行状态", allowableValues = "range[0, 2]")
    private Byte status;

    @ApiModelProperty(value = "面试结果", allowableValues = "range[0, 2]")
    private Byte result;

    @ApiModelProperty(value = "删除标记", notes = "相等")
    private Boolean deleted;

    @Override
    public Specification<AuditionRecord> toSpec() {
        return super.toSpecWithAnd();
    }
}
